#!/dis/sh
if {~ $#* 0} {re=.} {re=$*}

(weekday monthname day time zone year)=`{date}
monthnum=`{echo $monthname | sed -e 's,Jan,01,;s,Feb,02,;s,Mar,03,;s,Apr,04,;s,May,05,;s,Jun,06,;s,Jul,07,;s,Aug,08,;s,Sep,09,;s,Oct,10,;s,Nov,11,;s,Dec,12,'}

 nb -x todate | grep $year^$monthnum^' ' | grep $re | sed 's,'^`{pwd}^'/,,' | sed 's,(.*): (.*),\2 \1,g' | sort
 nb -x todate | grep $weekday^' ' | grep $re | sed 's,'^`{pwd}^'/,,' | sed 's,(.*): (.*),\2 \1,g' | sort
 nb -x todate | grep ' '^$monthnum^$day | grep $re | sed 's,'^`{pwd}^'/,,' | sed 's,(.*): (.*),\2 \1,g' | sort
 nb -x todate | grep $year^$monthnum^$day | grep $re | sed 's,'^`{pwd}^'/,,' | sed 's,(.*): (.*),\2 \1,g' | sort

exit
